<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="computerRoomList" checkbox="false" fitColumns="true" title="申请列表" actionUrl="computerRoomController.do?deviceApplyAuditDatagrid" idField="id" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="是否删除"  field="isDeleted" hidden="true" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="创建日期"  field="createDate" formatter="yyyy-MM-dd" hidden="true"  queryMode="single"  width="120"></t:dgCol>
   
   <t:dgCol title="名称"  field="computerRoom.name" queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="地址"  field="computerRoom.address" queryMode="single"  width="120"></t:dgCol>   
   <t:dgCol title="申请人"  field="applyUser.realName"  hidden="false"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="预约开始日期"  field="applyDate"  hidden="false"  queryMode="single"  width="120" formatter="yyyy-MM-dd hh:mm"></t:dgCol>
   <t:dgCol title="预约结束日期"  field="applyEndDate"  hidden="false"  queryMode="single"  width="120" formatter="yyyy-MM-dd hh:mm"></t:dgCol>
   <t:dgCol title="申请状态"  field="applyState.name"  hidden="false"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="选择座位"  field="selectedSeats"  hidden="false"  queryMode="single"  width="120"></t:dgCol>
   
   <t:dgCol title="操作" field="opt" width="130"></t:dgCol>
   <t:dgFunOpt funname="passApply(id)" title="通过"></t:dgFunOpt> 
   <t:dgFunOpt funname="fialPassApply(id)" title="不通过"></t:dgFunOpt>
	  
  </t:datagrid>
  </div>
 </div>
 <script src = "webpage/com/mengtian_tech/device_mgr/room/computerRoomList.js"></script>		
 <script type="text/javascript">
 $(document).ready(function(){
 		//给时间控件加上样式
		$("#computerRoomListtb").find("input[name='createDate']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
		$("#computerRoomListtb").find("input[name='updateDate']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 });
 

function passApply(id){
	$.dialog.confirm('确定要审核通过吗?', function(r) {
		   if (r) { 
				$.ajax({
					url : 'computerRoomController.do?deviceApplyAudit&result=1&id='+id,
					type : 'post', 
					cache : false,
					success : function(data) {
						var d = $.parseJSON(data);
						if (d.success) {
							var msg = d.msg;
							tip(msg);
							reloadTable(); 
						}else{
							tip(d.msg);
						}
					}
				});
			}
		}); 
}

function fialPassApply(id){
	$.dialog.confirm('确定要审核不通过吗?', function(r) {
		   if (r) { 
				$.ajax({
					url : 'computerRoomController.do?deviceApplyAudit&result=0&id='+id,
					type : 'post', 
					cache : false,
					success : function(data) {
						var d = $.parseJSON(data);
						if (d.success) {
							var msg = d.msg;
							tip(msg);
							reloadTable(); 
						}else{
							tip(msg);
						}
					}
				});
			}
		}); 
}
 </script>